package com.ftg.learn.product.mapper;

import com.ftg.learn.product.pojo.Dept;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DeptMapper {

    @Select("select * from dept")
    public List<Dept> show();

    @Select("select * from dept where deptno = #{deptno}")
    public List<Dept> findone(String deptno);

    @Update("update dept set dname=#{dname},loc=#{loc} where deptno = #{deptno}")
    public int update(Dept dept);

    @Delete("delete from dept where deptno=#{deptno}")
    public int delete(String deptno);

    @Insert("insert into dept(dname,loc) values(#{dname},#{loc})")
    public int save(Dept dept);
}
